Integrand size = 32, antiderivative size = 206 \[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(f+g x)^2} \, dx=\frac {(a+b x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(b f-a g) (f+g x)}+\frac {2 B (b c-a d) n \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \log \left (1-\frac {(d f-c g) (a+b x)}{(b f-a g) (c+d x)}\right )}{(b f-a g) (d f-c g)}+\frac {2 B^2 (b c-a d) n^2 \operatorname {PolyLog}\left (2,\frac {(d f-c g) (a+b x)}{(b f-a g) (c+d x)}\right )}{(b f-a g) (d f-c g)} \]
[Out]
Time = 0.12 (sec) , antiderivative size = 206, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {2553, 2355, 2354, 2438} \[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(f+g x)^2} \, dx=\frac {2 B n (b c-a d) \log \left (1-\frac {(a+b x) (d f-c g)}{(c+d x) (b f-a g)}\right ) \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )}{(b f-a g) (d f-c g)}+\frac {(a+b x) \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )^2}{(f+g x) (b f-a g)}+\frac {2 B^2 n^2 (b c-a d) \operatorname {PolyLog}\left (2,\frac {(d f-c g) (a+b x)}{(b f-a g) (c+d x)}\right )}{(b f-a g) (d f-c g)} \]
[In]
[Out]
Rule 2354
Rule 2355
Rule 2438
Rule 2553
Rubi steps \begin{align*} \text {integral}& = (b c-a d) \text {Subst}\left (\int \frac {\left (A+B \log \left (e x^n\right )\right )^2}{(b f-a g+(-d f+c g) x)^2} \, dx,x,\frac {a+b x}{c+d x}\right ) \\ & = \frac {(a+b x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(b f-a g) (f+g x)}-\frac {(2 B (b c-a d) n) \text {Subst}\left (\int \frac {A+B \log \left (e x^n\right )}{b f-a g+(-d f+c g) x} \, dx,x,\frac {a+b x}{c+d x}\right )}{b f-a g} \\ & = \frac {(a+b x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(b f-a g) (f+g x)}+\frac {2 B (b c-a d) n \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \log \left (1-\frac {(d f-c g) (a+b x)}{(b f-a g) (c+d x)}\right )}{(b f-a g) (d f-c g)}-\frac {\left (2 B^2 (b c-a d) n^2\right ) \text {Subst}\left (\int \frac {\log \left (1+\frac {(-d f+c g) x}{b f-a g}\right )}{x} \, dx,x,\frac {a+b x}{c+d x}\right )}{(b f-a g) (d f-c g)} \\ & = \frac {(a+b x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(b f-a g) (f+g x)}+\frac {2 B (b c-a d) n \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \log \left (1-\frac {(d f-c g) (a+b x)}{(b f-a g) (c+d x)}\right )}{(b f-a g) (d f-c g)}+\frac {2 B^2 (b c-a d) n^2 \text {Li}_2\left (\frac {(d f-c g) (a+b x)}{(b f-a g) (c+d x)}\right )}{(b f-a g) (d f-c g)} \\ \end{align*}
Leaf count is larger than twice the leaf count of optimal. \(418\) vs. \(2(206)=412\).
Time = 0.28 (sec) , antiderivative size = 418, normalized size of antiderivative = 2.03 \[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(f+g x)^2} \, dx=\frac {-\frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{f+g x}+\frac {B n \left (2 b (d f-c g) \log (a+b x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )-2 d (b f-a g) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \log (c+d x)+2 (b c-a d) g \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \log (f+g x)-b B (d f-c g) n \left (\log (a+b x) \left (\log (a+b x)-2 \log \left (\frac {b (c+d x)}{b c-a d}\right )\right )-2 \operatorname {PolyLog}\left (2,\frac {d (a+b x)}{-b c+a d}\right )\right )+B d (b f-a g) n \left (\left (2 \log \left (\frac {d (a+b x)}{-b c+a d}\right )-\log (c+d x)\right ) \log (c+d x)+2 \operatorname {PolyLog}\left (2,\frac {b (c+d x)}{b c-a d}\right )\right )-2 B (b c-a d) g n \left (\left (\log \left (\frac {g (a+b x)}{-b f+a g}\right )-\log \left (\frac {g (c+d x)}{-d f+c g}\right )\right ) \log (f+g x)+\operatorname {PolyLog}\left (2,\frac {b (f+g x)}{b f-a g}\right )-\operatorname {PolyLog}\left (2,\frac {d (f+g x)}{d f-c g}\right )\right )\right )}{(b f-a g) (d f-c g)}}{g} \]
[In]
[Out]
\[\int \frac {{\left (A +B \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right )\right )}^{2}}{\left (g x +f \right )^{2}}d x\]
[In]
[Out]
\[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(f+g x)^2} \, dx=\int { \frac {{\left (B \log \left (e \left (\frac {b x + a}{d x + c}\right )^{n}\right ) + A\right )}^{2}}{{\left (g x + f\right )}^{2}} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(f+g x)^2} \, dx=\text {Timed out} \]
[In]
[Out]
\[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(f+g x)^2} \, dx=\int { \frac {{\left (B \log \left (e \left (\frac {b x + a}{d x + c}\right )^{n}\right ) + A\right )}^{2}}{{\left (g x + f\right )}^{2}} \,d x } \]
[In]
[Out]
\[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(f+g x)^2} \, dx=\int { \frac {{\left (B \log \left (e \left (\frac {b x + a}{d x + c}\right )^{n}\right ) + A\right )}^{2}}{{\left (g x + f\right )}^{2}} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(f+g x)^2} \, dx=\int \frac {{\left (A+B\,\ln \left (e\,{\left (\frac {a+b\,x}{c+d\,x}\right )}^n\right )\right )}^2}{{\left (f+g\,x\right )}^2} \,d x \]
[In]
[Out]